<!DOCTYPE html>
<html>
<head>
    <title>会员、主播</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <i-form ref="formValidate" :model="apiUser" :rules="ruleValidate" :label-width="100">
        <Row>
            <i-col span="12">
                <Row>
                    <i-col span="16">
                        <Form-item label="主播头像" prop="avatar">
                            <img width="100px" height="100px" :src="avatar" v-show="showAvatar"/>
                        </Form-item>
                    </i-col>
                </Row>
                <Form-item label="海报（750*750）">
                    <template>
                        <div class="upload-list" v-for="item in uploadList">
                            <img :src="'https://www.qutuiya.com/'+item.url" width="180px" height="100px"/>
                            <div class="upload-list-cover">
                                <Icon type="ios-eye-outline" @click.native="handleView(item.url)"></Icon>
                            </div>
                        </div>
                    </template>
                </Form-item>

                <Form-item label="昵称" prop="nickname">
                    <i-input v-model="apiUser.nickname" placeholder="昵称"/>
                </Form-item>
                <Form-item label="手机" prop="phone">
                    <i-input v-model="phone" placeholder="手机"/>
                </Form-item>
                <Form-item label="可用金额" prop="availableAmount">
                    <i-input v-model="apiUser.availableAmount" placeholder="可提现金额"/>
                </Form-item>
                <Form-item label="可提现金额" prop="presentAmount">
                    <i-input v-model="apiUser.presentAmount" placeholder="可提现金额"/>
                </Form-item>
                <Form-item label="累计收益金额" prop="withdrawAmount">
                    <i-input v-model="apiUser.withdrawAmount" placeholder="累计收益金额"/>
                </Form-item>

                <Form-item label="出生日期" prop="birthday">
                    <Date-picker v-model="apiUser.birthday" placeholder="出生日期"></Date-picker>
                </Form-item>
                <Form-item label="注册时间" prop="registerTime">
                    <Date-picker v-model="apiUser.registerTime" placeholder="注册时间"></Date-picker>
                </Form-item>
                <Form-item label="近次登录" prop="lastLoginTime">
                    <Date-picker v-model="apiUser.lastLoginTime" placeholder="最后一次登录时间"></Date-picker>
                </Form-item>
                <Form-item label="亲密值" prop="intimacy">
                    <i-input v-model="apiUser.intimacy" placeholder="亲密值"/>
                </Form-item>
                <Form-item label="权重排序" prop="sort">
                    <i-select v-model="apiUser.sort" style="width:200px">
                        <i-option :value="1" :key="1">1</i-option>
                        <i-option :value="2" :key="2">2</i-option>
                        <i-option :value="3" :key="3">3</i-option>
                        <i-option :value="4" :key="4">4</i-option>
                        <i-option :value="5" :key="5">5</i-option>
                        <i-option :value="6" :key="6">6</i-option>
                        <i-option :value="7" :key="7">7</i-option>
                        <i-option :value="8" :key="8">8</i-option>
                        <i-option :value="9" :key="9">9</i-option>
                        <i-option :value="10" :key="10">10</i-option>
                    </i-select>
                    <!--<i-input v-model="apiUser.sort" placeholder="权重排序 10-1"/>-->
                </Form-item>

            </i-col>
            <i-col span="12">

                <Form-item label="城市" prop="cityName">
                    <i-input v-model="apiUser.cityName" placeholder="所在城市名称"/>
                </Form-item>
                <Form-item label="年龄" prop="age">
                    <i-input v-model="apiUser.age" placeholder="年龄"/>
                </Form-item>
                <Form-item label="性别" prop="gender">
                    <Radio-group v-model="apiUser.gender">
                        <Radio label="1">
                            <span>男</span>
                        </Radio>
                        <Radio label="2">
                            <span>女</span>
                        </Radio>
                    </Radio-group>
                </Form-item>
                <Form-item label="星座" prop="constellation">
                    <i-input v-model="apiUser.constellation" placeholder="星座"/>
                </Form-item>
                <Form-item label="身高（cm）" prop="height">
                    <i-input v-model="apiUser.height" placeholder="身高（cm）"/>
                </Form-item>
                <Form-item label="体重（kg）" prop="weight">
                    <i-input v-model="apiUser.weight" placeholder="体重（kg）"/>
                </Form-item>
                <Form-item label="个人介绍" prop="introduction">
                    <i-input type="textarea" v-model="apiUser.introduction" placeholder="个人介绍"/>
                </Form-item>
                <Form-item label="状态" prop="status">
                    <Radio-group v-model="apiUser.status">
                        <Radio label="1">
                            <span>有效</span>
                        </Radio>
                        <Radio label="2">
                            <span>禁用</span>
                        </Radio>
                    </Radio-group>
                </Form-item>
                <Form-item label="类型" prop="type">
                    <Radio-group v-model="apiUser.type">
                        <Radio label="1">
                            <span>精选</span>
                        </Radio>
                        <Radio label="2">
                            <span>新人</span>
                        </Radio>
                    </Radio-group>
                </Form-item>
                <Form-item label="申请状态" prop="applicationStatus">
                    <Radio-group v-model="apiUser.applicationStatus">
                        <Radio label="1">
                            <span>未提交</span>
                        </Radio>
                        <Radio label="2">
                            <span>待审核</span>
                        </Radio>
                        <Radio label="3">
                            <span>审核通过</span>
                        </Radio>
                        <Radio label="4">
                            <span>审核失败</span>
                        </Radio>
                    </Radio-group>
                </Form-item>
                <Form-item label="在线状态" prop="onlineStatus">
                    <Radio-group v-model="apiUser.onlineStatus">
                        <Radio label="1">
                            <span>在线</span>
                        </Radio>
                        <Radio label="2">
                            <span>在聊 </span>
                        </Radio>
                        <Radio label="3">
                            <span>勿扰</span>
                        </Radio>
                        <Radio label="4">
                            <span>离线</span>
                        </Radio>
                    </Radio-group>
                </Form-item>


            </i-col>
        </Row>

        <Row>
            <i-col span="12">
                <Form-item label="一对一视频" prop="live">
                    <Radio-group v-model="apiUser.live">
                        <Radio label="1">
                            <span>开通</span>
                        </Radio>
                        <Radio label="2">
                            <span>未开通</span>
                        </Radio>
                    </Radio-group>
                </Form-item>
            </i-col>
            <i-col span="12">
                <Form-item label="一对一视频单价" prop="livePrice">
                    <i-input v-model="apiUser.livePrice" placeholder="一对一直播单价"/>
                </Form-item>
            </i-col>

            <i-col span="24">
                <Form-item label="经纪人" prop="agent">
                    <i-Select v-model="apiUser.agent" placeholder="">
                        <i-Option v-for="item in agentList" :value="item.userId" :key="item.userId">{{ item.username }}
                        </i-Option>
                    </i-Select>
                </Form-item>
            </i-col>
        </Row>
    </i-form>
</div>


<script type="text/javascript">
    let id = getQueryString("userId");

    let vm = new Vue({
        el: '#rrapp',
        data: {
            title: null,
            apiUser: {},
            phone: "",
            uploadList: [],
            agentList: [],
            visible: false,
            showAvatar: false,
            avatar: '',
            ruleValidate: {
                name: [
                    {required: true, message: '名称不能为空', trigger: 'blur'}
                ]
            },
            q: {
                name: ''
            }
        },
        created: function () {
            $.get("../user/info/" + id, function (r) {
                vm.apiUser = r.apiUser;
                vm.avatar = 'https://www.qutuiya.com/' + r.apiUser.avatar;
                vm.phone = r.phone;
            });
            $.get("../user/listAgent", function (r) {
                vm.agentList = r.list;
            });
            $.get("../user/audlting/" + id, function (r) {
                vm.uploadList = r.picList;
            });
        },

        methods: {

            handleSubmit: function (name) {
                handleSubmitValidate(this, name, function () {
                    vm.saveOrUpdate()
                });
            },
            handleSuccessAvatar: function (res, file) {
                vm.showAvatar = true;
                vm.apiUser.avatar = file.response.data.url;
                vm.avatar = 'https://www.qutuiya.com/' + file.response.data.url;
            },
            handleReset: function (name) {
                handleResetForm(this, name);
            }
        }
    });

</script>


</body>
</html>